<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Zip Iterator</title>
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../index.html" title="Chapter 1. Boost.Iterator">
<link rel="up" href="../specialized.html" title="Specialized Adaptors">
<link rel="prev" href="transform.html" title="Transform Iterator">
<link rel="next" href="../utilities.html" title="Utilities">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="transform.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../specialized.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="../utilities.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="iterator.specialized.zip"></a><a class="link" href="zip.html" title="Zip Iterator">Zip Iterator</a>
</h3></div></div></div>
<div class="toc"><dl class="toc">
<dt><span class="section"><a href="zip.html#iterator.specialized.zip.zip_example">Example</a></span></dt>
<dt><span class="section"><a href="zip.html#iterator.specialized.zip.zip_reference">Reference</a></span></dt>
</dl></div>
<p>
        The zip iterator provides the ability to parallel-iterate over several controlled
        sequences simultaneously. A zip iterator is constructed from a tuple of iterators.
        Moving the zip iterator moves all the iterators in parallel. Dereferencing
        the zip iterator returns a tuple that contains the results of dereferencing
        the individual iterators.
      </p>
<p>
        The tuple of iterators is now implemented in terms of a Boost fusion sequence.
        Because of this the 'tuple' may be any Boost fusion sequence and, for backwards
        compatibility through a Boost fusion sequence adapter, a Boost tuple. Because
        the 'tuple' may be any boost::fusion sequence the 'tuple' may also be any
        type for which a Boost fusion adapter exists. This includes, among others,
        a std::tuple and a std::pair. Just remember to include the appropriate Boost
        fusion adapter header files for these other Boost fusion adapters. The zip_iterator
        header file already includes the Boost fusion adapter header file for Boost
        tuple, so you need not include it yourself to use a Boost tuple as your 'tuple'.
      </p>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="iterator.specialized.zip.zip_example"></a><a class="link" href="zip.html#iterator.specialized.zip.zip_example" title="Example">Example</a>
</h4></div></div></div>
<p>
          There are two main types of applications of the <code class="computeroutput"><span class="identifier">zip_iterator</span></code>.
          The first one concerns runtime efficiency: If one has several controlled
          sequences of the same length that must be somehow processed, e.g., with
          the <code class="computeroutput"><span class="identifier">for_each</span></code> algorithm,
          then it is more efficient to perform just one parallel-iteration rather
          than several individual iterations. For an example, assume that <code class="computeroutput"><span class="identifier">vect_of_doubles</span></code> and <code class="computeroutput"><span class="identifier">vect_of_ints</span></code>
          are two vectors of equal length containing doubles and ints, respectively,
          and consider the following two iterations:
        </p>
<pre class="programlisting"><span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="keyword">double</span><span class="special">&gt;::</span><span class="identifier">const_iterator</span> <span class="identifier">beg1</span> <span class="special">=</span> <span class="identifier">vect_of_doubles</span><span class="special">.</span><span class="identifier">begin</span><span class="special">();</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="keyword">double</span><span class="special">&gt;::</span><span class="identifier">const_iterator</span> <span class="identifier">end1</span> <span class="special">=</span> <span class="identifier">vect_of_doubles</span><span class="special">.</span><span class="identifier">end</span><span class="special">();</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="keyword">int</span><span class="special">&gt;::</span><span class="identifier">const_iterator</span> <span class="identifier">beg2</span> <span class="special">=</span> <span class="identifier">vect_of_ints</span><span class="special">.</span><span class="identifier">begin</span><span class="special">();</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="keyword">int</span><span class="special">&gt;::</span><span class="identifier">const_iterator</span> <span class="identifier">end2</span> <span class="special">=</span> <span class="identifier">vect_of_ints</span><span class="special">.</span><span class="identifier">end</span><span class="special">();</span>

<span class="identifier">std</span><span class="special">::</span><span class="identifier">for_each</span><span class="special">(</span><span class="identifier">beg1</span><span class="special">,</span> <span class="identifier">end1</span><span class="special">,</span> <span class="identifier">func_0</span><span class="special">());</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">for_each</span><span class="special">(</span><span class="identifier">beg2</span><span class="special">,</span> <span class="identifier">end2</span><span class="special">,</span> <span class="identifier">func_1</span><span class="special">());</span>
</pre>
<p>
          These two iterations can now be replaced with a single one as follows:
        </p>
<pre class="programlisting"><span class="identifier">std</span><span class="special">::</span><span class="identifier">for_each</span><span class="special">(</span>
  <span class="identifier">boost</span><span class="special">::</span><span class="identifier">make_zip_iterator</span><span class="special">(</span>
    <span class="identifier">boost</span><span class="special">::</span><span class="identifier">make_tuple</span><span class="special">(</span><span class="identifier">beg1</span><span class="special">,</span> <span class="identifier">beg2</span><span class="special">)</span>
    <span class="special">),</span>
  <span class="identifier">boost</span><span class="special">::</span><span class="identifier">make_zip_iterator</span><span class="special">(</span>
    <span class="identifier">boost</span><span class="special">::</span><span class="identifier">make_tuple</span><span class="special">(</span><span class="identifier">end1</span><span class="special">,</span> <span class="identifier">end2</span><span class="special">)</span>
    <span class="special">),</span>
  <span class="identifier">zip_func</span><span class="special">()</span>
  <span class="special">);</span>
</pre>
<p>
          A non-generic implementation of <code class="computeroutput"><span class="identifier">zip_func</span></code>
          could look as follows:
        </p>
<pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">zip_func</span> <span class="special">:</span>
  <span class="keyword">public</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">unary_function</span><span class="special">&lt;</span><span class="keyword">const</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">tuple</span><span class="special">&lt;</span><span class="keyword">const</span> <span class="keyword">double</span><span class="special">&amp;,</span> <span class="keyword">const</span> <span class="keyword">int</span><span class="special">&amp;&gt;&amp;,</span> <span class="keyword">void</span><span class="special">&gt;</span>
<span class="special">{</span>
  <span class="keyword">void</span> <span class="keyword">operator</span><span class="special">()(</span><span class="keyword">const</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">tuple</span><span class="special">&lt;</span><span class="keyword">const</span> <span class="keyword">double</span><span class="special">&amp;,</span> <span class="keyword">const</span> <span class="keyword">int</span><span class="special">&amp;&gt;&amp;</span> <span class="identifier">t</span><span class="special">)</span> <span class="keyword">const</span>
  <span class="special">{</span>
    <span class="identifier">m_f0</span><span class="special">(</span><span class="identifier">t</span><span class="special">.</span><span class="identifier">get</span><span class="special">&lt;</span><span class="number">0</span><span class="special">&gt;());</span>
    <span class="identifier">m_f1</span><span class="special">(</span><span class="identifier">t</span><span class="special">.</span><span class="identifier">get</span><span class="special">&lt;</span><span class="number">1</span><span class="special">&gt;());</span>
  <span class="special">}</span>

<span class="keyword">private</span><span class="special">:</span>
  <span class="identifier">func_0</span> <span class="identifier">m_f0</span><span class="special">;</span>
  <span class="identifier">func_1</span> <span class="identifier">m_f1</span><span class="special">;</span>
<span class="special">};</span>
</pre>
<p>
          The second important application of the <code class="computeroutput"><span class="identifier">zip_iterator</span></code>
          is as a building block to make combining iterators. A combining iterator
          is an iterator that parallel-iterates over several controlled sequences
          and, upon dereferencing, returns the result of applying a functor to the
          values of the sequences at the respective positions. This can now be achieved
          by using the <code class="computeroutput"><span class="identifier">zip_iterator</span></code>
          in conjunction with the <code class="computeroutput"><span class="identifier">transform_iterator</span></code>.
        </p>
<p>
          Suppose, for example, that you have two vectors of doubles, say <code class="computeroutput"><span class="identifier">vect_1</span></code> and <code class="computeroutput"><span class="identifier">vect_2</span></code>,
          and you need to expose to a client a controlled sequence containing the
          products of the elements of <code class="computeroutput"><span class="identifier">vect_1</span></code>
          and <code class="computeroutput"><span class="identifier">vect_2</span></code>. Rather than
          placing these products in a third vector, you can use a combining iterator
          that calculates the products on the fly. Let us assume that <code class="computeroutput"><span class="identifier">tuple_multiplies</span></code> is a functor that works
          like <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">multiplies</span></code>, except that it takes its
          two arguments packaged in a tuple. Then the two iterators <code class="computeroutput"><span class="identifier">it_begin</span></code> and <code class="computeroutput"><span class="identifier">it_end</span></code>
          defined below delimit a controlled sequence containing the products of
          the elements of <code class="computeroutput"><span class="identifier">vect_1</span></code>
          and <code class="computeroutput"><span class="identifier">vect_2</span></code>:
        </p>
<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">tuple</span><span class="special">&lt;</span>
  <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="keyword">double</span><span class="special">&gt;::</span><span class="identifier">const_iterator</span><span class="special">,</span>
  <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="keyword">double</span><span class="special">&gt;::</span><span class="identifier">const_iterator</span>
  <span class="special">&gt;</span> <span class="identifier">the_iterator_tuple</span><span class="special">;</span>

<span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">zip_iterator</span><span class="special">&lt;</span>
  <span class="identifier">the_iterator_tuple</span>
  <span class="special">&gt;</span> <span class="identifier">the_zip_iterator</span><span class="special">;</span>

<span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">transform_iterator</span><span class="special">&lt;</span>
  <span class="identifier">tuple_multiplies</span><span class="special">&lt;</span><span class="keyword">double</span><span class="special">&gt;,</span>
  <span class="identifier">the_zip_iterator</span>
  <span class="special">&gt;</span> <span class="identifier">the_transform_iterator</span><span class="special">;</span>

<span class="identifier">the_transform_iterator</span> <span class="identifier">it_begin</span><span class="special">(</span>
  <span class="identifier">the_zip_iterator</span><span class="special">(</span>
    <span class="identifier">the_iterator_tuple</span><span class="special">(</span>
      <span class="identifier">vect_1</span><span class="special">.</span><span class="identifier">begin</span><span class="special">(),</span>
      <span class="identifier">vect_2</span><span class="special">.</span><span class="identifier">begin</span><span class="special">()</span>
      <span class="special">)</span>
    <span class="special">),</span>
  <span class="identifier">tuple_multiplies</span><span class="special">&lt;</span><span class="keyword">double</span><span class="special">&gt;()</span>
  <span class="special">);</span>

<span class="identifier">the_transform_iterator</span> <span class="identifier">it_end</span><span class="special">(</span>
  <span class="identifier">the_zip_iterator</span><span class="special">(</span>
    <span class="identifier">the_iterator_tuple</span><span class="special">(</span>
      <span class="identifier">vect_1</span><span class="special">.</span><span class="identifier">end</span><span class="special">(),</span>
      <span class="identifier">vect_2</span><span class="special">.</span><span class="identifier">end</span><span class="special">()</span>
      <span class="special">)</span>
    <span class="special">),</span>
  <span class="identifier">tuple_multiplies</span><span class="special">&lt;</span><span class="keyword">double</span><span class="special">&gt;()</span>
  <span class="special">);</span>
</pre>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="iterator.specialized.zip.zip_reference"></a><a class="link" href="zip.html#iterator.specialized.zip.zip_reference" title="Reference">Reference</a>
</h4></div></div></div>
<h3>
<a name="iterator.specialized.zip.zip_reference.h0"></a>
          <span class="phrase"><a name="iterator.specialized.zip.zip_reference.synopsis"></a></span><a class="link" href="zip.html#iterator.specialized.zip.zip_reference.synopsis">Synopsis</a>
        </h3>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">IteratorTuple</span><span class="special">&gt;</span>
<span class="keyword">class</span> <span class="identifier">zip_iterator</span>
<span class="special">{</span>

<span class="keyword">public</span><span class="special">:</span>
  <span class="keyword">typedef</span> <span class="comment">/* see below */</span> <span class="identifier">reference</span><span class="special">;</span>
  <span class="keyword">typedef</span> <span class="identifier">reference</span> <span class="identifier">value_type</span><span class="special">;</span>
  <span class="keyword">typedef</span> <span class="identifier">value_type</span><span class="special">*</span> <span class="identifier">pointer</span><span class="special">;</span>
  <span class="keyword">typedef</span> <span class="comment">/* see below */</span> <span class="identifier">difference_type</span><span class="special">;</span>
  <span class="keyword">typedef</span> <span class="comment">/* see below */</span> <span class="identifier">iterator_category</span><span class="special">;</span>

  <span class="identifier">zip_iterator</span><span class="special">();</span>
  <span class="identifier">zip_iterator</span><span class="special">(</span><span class="identifier">IteratorTuple</span> <span class="identifier">iterator_tuple</span><span class="special">);</span>

  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">OtherIteratorTuple</span><span class="special">&gt;</span>
  <span class="identifier">zip_iterator</span><span class="special">(</span>
        <span class="keyword">const</span> <span class="identifier">zip_iterator</span><span class="special">&lt;</span><span class="identifier">OtherIteratorTuple</span><span class="special">&gt;&amp;</span> <span class="identifier">other</span>
      <span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">enable_if_convertible</span><span class="special">&lt;</span>
              <span class="identifier">OtherIteratorTuple</span>
            <span class="special">,</span> <span class="identifier">IteratorTuple</span><span class="special">&gt;::</span><span class="identifier">type</span><span class="special">*</span> <span class="special">=</span> <span class="number">0</span>     <span class="comment">// exposition only</span>
  <span class="special">);</span>

  <span class="keyword">const</span> <span class="identifier">IteratorTuple</span><span class="special">&amp;</span> <span class="identifier">get_iterator_tuple</span><span class="special">()</span> <span class="keyword">const</span><span class="special">;</span>

<span class="keyword">private</span><span class="special">:</span>
  <span class="identifier">IteratorTuple</span> <span class="identifier">m_iterator_tuple</span><span class="special">;</span>     <span class="comment">// exposition only</span>
<span class="special">};</span>

<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">IteratorTuple</span><span class="special">&gt;</span>
<span class="identifier">zip_iterator</span><span class="special">&lt;</span><span class="identifier">IteratorTuple</span><span class="special">&gt;</span>
<span class="identifier">make_zip_iterator</span><span class="special">(</span><span class="identifier">IteratorTuple</span> <span class="identifier">t</span><span class="special">);</span>
</pre>
<p>
          The <code class="computeroutput"><span class="identifier">reference</span></code> member of
          <code class="computeroutput"><span class="identifier">zip_iterator</span></code> is the type
          of the tuple made of the reference types of the iterator types in the
          <code class="computeroutput"><span class="identifier">IteratorTuple</span></code> argument.
        </p>
<p>
          The <code class="computeroutput"><span class="identifier">difference_type</span></code> member
          of <code class="computeroutput"><span class="identifier">zip_iterator</span></code> is the
          <code class="computeroutput"><span class="identifier">difference_type</span></code> of the
          first of the iterator types in the <code class="computeroutput"><span class="identifier">IteratorTuple</span></code>
          argument.
        </p>
<p>
          The <code class="computeroutput"><span class="identifier">iterator_category</span></code> member
          of <code class="computeroutput"><span class="identifier">zip_iterator</span></code> is convertible
          to the minimum of the traversal categories of the iterator types in the
          <code class="computeroutput"><span class="identifier">IteratorTuple</span></code> argument.
          For example, if the <code class="computeroutput"><span class="identifier">zip_iterator</span></code>
          holds only vector iterators, then <code class="computeroutput"><span class="identifier">iterator_category</span></code>
          is convertible to <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">random_access_traversal_tag</span></code>.
          If you add a list iterator, then <code class="computeroutput"><span class="identifier">iterator_category</span></code>
          will be convertible to <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">bidirectional_traversal_tag</span></code>,
          but no longer to <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">random_access_traversal_tag</span></code>.
        </p>
<h3>
<a name="iterator.specialized.zip.zip_reference.h1"></a>
          <span class="phrase"><a name="iterator.specialized.zip.zip_reference.requirements"></a></span><a class="link" href="zip.html#iterator.specialized.zip.zip_reference.requirements">Requirements</a>
        </h3>
<p>
          All iterator types in the argument <code class="computeroutput"><span class="identifier">IteratorTuple</span></code>
          shall model Readable Iterator.
        </p>
<h3>
<a name="iterator.specialized.zip.zip_reference.h2"></a>
          <span class="phrase"><a name="iterator.specialized.zip.zip_reference.concepts"></a></span><a class="link" href="zip.html#iterator.specialized.zip.zip_reference.concepts">Concepts</a>
        </h3>
<p>
          The resulting <code class="computeroutput"><span class="identifier">zip_iterator</span></code>
          models Readable Iterator.
        </p>
<p>
          The fact that the <code class="computeroutput"><span class="identifier">zip_iterator</span></code>
          models only Readable Iterator does not prevent you from modifying the values
          that the individual iterators point to. The tuple returned by the <code class="computeroutput"><span class="identifier">zip_iterator</span></code>'s <code class="computeroutput"><span class="keyword">operator</span><span class="special">*</span></code> is a tuple constructed from the reference
          types of the individual iterators, not their value types. For example,
          if <code class="computeroutput"><span class="identifier">zip_it</span></code> is a <code class="computeroutput"><span class="identifier">zip_iterator</span></code> whose first member iterator
          is an <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="keyword">double</span><span class="special">&gt;::</span><span class="identifier">iterator</span></code>, then the following line will
          modify the value which the first member iterator of <code class="computeroutput"><span class="identifier">zip_it</span></code>
          currently points to:
        </p>
<pre class="programlisting"><span class="identifier">zip_it</span><span class="special">-&gt;</span><span class="identifier">get</span><span class="special">&lt;</span><span class="number">0</span><span class="special">&gt;()</span> <span class="special">=</span> <span class="number">42.0</span><span class="special">;</span>
</pre>
<p>
          Consider the set of standard traversal concepts obtained by taking the
          most refined standard traversal concept modeled by each individual iterator
          type in the <code class="computeroutput"><span class="identifier">IteratorTuple</span></code>
          argument.The <code class="computeroutput"><span class="identifier">zip_iterator</span></code>
          models the least refined standard traversal concept in this set.
        </p>
<p>
          <code class="computeroutput"><span class="identifier">zip_iterator</span><span class="special">&lt;</span><span class="identifier">IteratorTuple1</span><span class="special">&gt;</span></code>
          is interoperable with <code class="computeroutput"><span class="identifier">zip_iterator</span><span class="special">&lt;</span><span class="identifier">IteratorTuple2</span><span class="special">&gt;</span></code> if and only if <code class="computeroutput"><span class="identifier">IteratorTuple1</span></code>
          is interoperable with <code class="computeroutput"><span class="identifier">IteratorTuple2</span></code>.
        </p>
<h3>
<a name="iterator.specialized.zip.zip_reference.h3"></a>
          <span class="phrase"><a name="iterator.specialized.zip.zip_reference.operations"></a></span><a class="link" href="zip.html#iterator.specialized.zip.zip_reference.operations">Operations</a>
        </h3>
<p>
          In addition to the operations required by the concepts modeled by <code class="computeroutput"><span class="identifier">zip_iterator</span></code>, <code class="computeroutput"><span class="identifier">zip_iterator</span></code>
          provides the following operations.
        </p>
<pre class="programlisting"><span class="identifier">zip_iterator</span><span class="special">();</span>
</pre>
<p>
          <span class="bold"><strong>Returns:</strong></span> An instance of <code class="computeroutput"><span class="identifier">zip_iterator</span></code> with <code class="computeroutput"><span class="identifier">m_iterator_tuple</span></code>
          default constructed.
        </p>
<pre class="programlisting"><span class="identifier">zip_iterator</span><span class="special">(</span><span class="identifier">IteratorTuple</span> <span class="identifier">iterator_tuple</span><span class="special">);</span>
</pre>
<p>
          <span class="bold"><strong>Returns:</strong></span> An instance of <code class="computeroutput"><span class="identifier">zip_iterator</span></code> with <code class="computeroutput"><span class="identifier">m_iterator_tuple</span></code>
          initialized to <code class="computeroutput"><span class="identifier">iterator_tuple</span></code>.
        </p>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">OtherIteratorTuple</span><span class="special">&gt;</span>
<span class="identifier">zip_iterator</span><span class="special">(</span>
      <span class="keyword">const</span> <span class="identifier">zip_iterator</span><span class="special">&lt;</span><span class="identifier">OtherIteratorTuple</span><span class="special">&gt;&amp;</span> <span class="identifier">other</span>
    <span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">enable_if_convertible</span><span class="special">&lt;</span>
            <span class="identifier">OtherIteratorTuple</span>
          <span class="special">,</span> <span class="identifier">IteratorTuple</span><span class="special">&gt;::</span><span class="identifier">type</span><span class="special">*</span> <span class="special">=</span> <span class="number">0</span>     <span class="comment">// exposition only</span>
<span class="special">);</span>
</pre>
<p>
          <span class="bold"><strong>Returns:</strong></span> An instance of <code class="computeroutput"><span class="identifier">zip_iterator</span></code> that is a copy of <code class="computeroutput"><span class="identifier">other</span></code>.<br> <span class="bold"><strong>Requires:</strong></span>
          <code class="computeroutput"><span class="identifier">OtherIteratorTuple</span></code> is implicitly
          convertible to <code class="computeroutput"><span class="identifier">IteratorTuple</span></code>.
        </p>
<pre class="programlisting"><span class="keyword">const</span> <span class="identifier">IteratorTuple</span><span class="special">&amp;</span> <span class="identifier">get_iterator_tuple</span><span class="special">()</span> <span class="keyword">const</span><span class="special">;</span>
</pre>
<p>
          <span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="identifier">m_iterator_tuple</span></code>
        </p>
<pre class="programlisting"><span class="identifier">reference</span> <span class="keyword">operator</span><span class="special">*()</span> <span class="keyword">const</span><span class="special">;</span>
</pre>
<p>
          <span class="bold"><strong>Returns:</strong></span> A tuple consisting of the results
          of dereferencing all iterators in <code class="computeroutput"><span class="identifier">m_iterator_tuple</span></code>.
        </p>
<pre class="programlisting"><span class="identifier">zip_iterator</span><span class="special">&amp;</span> <span class="keyword">operator</span><span class="special">++();</span>
</pre>
<p>
          <span class="bold"><strong>Effects:</strong></span> Increments each iterator in
          <code class="computeroutput"><span class="identifier">m_iterator_tuple</span></code>.<br>
          <span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="special">*</span><span class="keyword">this</span></code>
        </p>
<pre class="programlisting"><span class="identifier">zip_iterator</span><span class="special">&amp;</span> <span class="keyword">operator</span><span class="special">--();</span>
</pre>
<p>
          <span class="bold"><strong>Effects:</strong></span> Decrements each iterator in
          <code class="computeroutput"><span class="identifier">m_iterator_tuple</span></code>.<br>
          <span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="special">*</span><span class="keyword">this</span></code>
        </p>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">IteratorTuple</span><span class="special">&gt;</span>
<span class="identifier">zip_iterator</span><span class="special">&lt;</span><span class="identifier">IteratorTuple</span><span class="special">&gt;</span>
<span class="identifier">make_zip_iterator</span><span class="special">(</span><span class="identifier">IteratorTuple</span> <span class="identifier">t</span><span class="special">);</span>
</pre>
<p>
          <span class="bold"><strong>Returns:</strong></span> An instance of <code class="computeroutput"><span class="identifier">zip_iterator</span><span class="special">&lt;</span><span class="identifier">IteratorTuple</span><span class="special">&gt;</span></code>
          with <code class="computeroutput"><span class="identifier">m_iterator_tuple</span></code> initialized
          to <code class="computeroutput"><span class="identifier">t</span></code>.
        </p>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2003, 2005 David Abrahams Jeremy Siek Thomas
      Witt<p>
        Distributed under the Boost Software License, Version 1.0. (See accompanying
        file LICENSE_1_0.txt or copy at &lt;ulink url="http://www.boost.org/LICENSE_1_0.txt"&gt;
        http://www.boost.org/LICENSE_1_0.txt &lt;/ulink&gt;)
      </p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="transform.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../specialized.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="../utilities.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>
